CreateFieldDefFile
Creates a tab-separated text file, known as a field definition file, which represents the structure of the data in a specified Recordset or Rowset object. This field definition file can then be used to design a report file using the Runtime DB option in the Create Report Expert of Crystal Reports. When designing an application that prints, previews, or exports the report, the field definition file can be replaced, at runtime, by the Recordset or Rowset object.
C Syntax
BOOL FAR PASCAL CreateFieldDefFile(LPUNKNOWN FAR *lpUnk,
LPCSTR fileName,
BOOL bOverWriteExistingFile);
Visual Basic Syntax
Declare Function CreateFieldDefFile Lib "p2smon.dll"(lpUnk As Object, _
ByVal fileName As String, ByVal bOverWriteExistingFile As Long) _
As Long
Parameters
Parameter
| Description
|
lpUnk
| The active data source used to create the field definition file. In C or C++, this is a pointer to an Iunknown derived COM interface relating to a DAO or ADO Recordset. In Visual Basic, this is a Recordset or Rowset object.
|
fileName
| The path and file name of the field definition file to be created.
|
bOverWriteExistingFile
| If a field definition file already exists with the specified path and file name, this flag indicates whether or not to overwrite that file.
|
Return Value
Returns 0 (False) if the call failed. Returns 1 (True) if the call succeeded and the field definition file was created.
Remarks
This function creates a field definition file only, and does not create a report file. You must create a report file using Crystal Reports.